import Mock from 'mockjs'
export default {
    getMenu:config=>{
        const {username,password}=JSON.parse(config.body)
        if(username==='admin'&&password==='admin'){
            return{
                code:200,
                data:{
                    menu:[
                        {
                            path:'/home',
                            name:'home',
                            label:'首页',
                            icon:'house',
                            url:'home/home'
                        },
                        {
                            path: "/user",
                            name: "user",
                            label: "用户管理",
                            icon: "user",
                            url: "user/user"
                          },
                          {
                            label: "其他11",
                            icon: "location",
                            redirect:'page1',
                            path: "/other",
                            name: "other",
                            // path: "/other",
                            children: [
                              {
                                path: "/page1",
                                name: "page1",
                                label: "页面1",
                                icon: "setting",
                                url: "page1"
                              },
                              {
                                path: "/page2",
                                name: "page2",
                                label: "页面2",
                                icon: "setting",
                                url: "page2"
                              }
                            ]
                          }
                    ],
                    token:Mock.Random.guid(),
                    message:'获取成功'
                }
            }
        }else{
            return{
                code:-999,
                data:{
                    message:'密码错误'
                }
            }
        }
    }
}